﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rapid
{
    class FacilityView
    {
        static RapidDataDataContext db = new RapidDataDataContext();

        public static string getDoctor()
        {
            return (db.Facilities.Count() > 0) ? 
                db.Facilities.OrderByDescending(p => p.Id).First().Name
                : "";
        }

        public static string getAddress()
        {
            return (db.Facilities.Count() > 0) ?
                db.Facilities.OrderByDescending(p => p.Id).First().Address
                : "";
        }

        public static string getCountry()
        {
            return (db.Facilities.Count() > 0) ?
                db.Facilities.OrderByDescending(p => p.Id).First().Country
                : "";
        }

        public static string getPhone()
        {
            return (db.Facilities.Count() > 0) ?
                db.Facilities.OrderByDescending(p => p.Id).First().Phone
                : "";
        }

        public static string getFax()
        {
            return (db.Facilities.Count() > 0) ?
                db.Facilities.OrderByDescending(p => p.Id).First().Fax
                : "";
        }

        public static string getEmail()
        {
            return (db.Facilities.Count() > 0) ?
                db.Facilities.OrderByDescending(p => p.Id).First().Email
                : "";
        }
    }
}
